import type * as Project from './type.js';
import { request } from '@/http/axios.ts';

/** 获取项目角色列表 */
export const getRoleListApi = async (data: any) =>
  request({
    url: '/projectMember/getRoleList',
    method: 'POST',
    data,
  });

/** 获取项目成员列表 */
export const getProjectMemberList = async (data: any) =>
  request({
    url: '/projectMember/getProjectMemberList',
    method: 'POST',
    data,
  });

/** 获取项目成员详情 */
export const getProjectMemberDetail = async (data: any) =>
  request({
    url: '/projectMember/getProjectMemberDetail',
    method: 'POST',
    data,
  });

/** 更新项目成员详情 */
export const updateProjectMemberDetail = async (data: any) =>
  request({
    url: '/projectMember/updateProjectMemberDetail',
    method: 'POST',
    data,
  });

/** 删除项目成员 */
export const deleteProjectMember = async (data: any) =>
  request({
    url: '/projectMember/deleteProjectMember',
    method: 'POST',
    data,
  });

/** 获取角色详情 */
export const getRole = async (data: any) =>
  request({
    url: '/projectMember/getRole',
    method: 'POST',
    data,
  });

/** 创建项目角色 */
export const createRole = async (data: any) =>
  request({
    url: '/projectMember/createRole',
    method: 'POST',
    data,
  });

/** 更新项目角色 */
export const updateRole = async (data: any) =>
  request({
    url: '/projectMember/updateRole',
    method: 'POST',
    data,
  });

/** 删除项目角色 */
export const deleteRoleApi = async (data: any) =>
  request({
    url: '/projectMember/deleteRole',
    method: 'POST',
    data,
  });

/** 获取项目角色权限树 */
export const getRolePermissionTree = async (data: any) =>
  request({
    url: '/projectMember/getRolePermissionTree',
    method: 'POST',
    data,
  });

/** 更新项目角色权限树 */
export const updateRolePermissionTreeApi = async (data: any) =>
  request({
    url: '/projectMember/updateRolePermissionTreeApi',
    method: 'POST',
    data,
  });

/** 获取项目权限 */
export const getProjectPermissionsApi = async (data: any) =>
  request({
    url: '/projectMember/getProjectPermissionsApi',
    method: 'POST',
    data,
  });

/** 获取所有用户 */
export const getUserList = async () =>
  request({
    url: '/projectMember/getUserList',
    method: 'POST',
  });

/** 添加项目成员 */
export const addProjectMember = async (data: any) =>
  request({
    url: '/projectMember/addProjectMember',
    method: 'POST',
    data,
  });